#pragma once

#include <winsock2.h>
#include "NetInit.h"
#include "Application/Application.h"
#include "Handler.h"
#include "NetAddr.h"
#include "CommonDefine/MessageDefine.h"
#include "CommonLib/Singleton.h"

class Network : public Singleton<Network>, public Application::SystemElement , public Handler
{
public:
	virtual void init();
	void connectServer(const char*, unsigned short);
	virtual void onReceiveMessage(const MsgHeader*);
	virtual void end();
	
private:
	NetInit mNetInit;
	NetAddr mNetAddr;
};